package org.aceor.mddal.gateway.sqlparser;

import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import org.aceor.mddal.common.sqlparser.result.context.ShardingContext;

import java.util.List;
import java.util.Map;

/**
 * Created by lxue on 16/4/11.
 */
public class SQLParserFactory {

    public static SQLParserEngine createSQLParserEngine(
            final String sql,
            final List<Object> args, Map<String, ShardingContext> allTableShardingColumnsMapping) {
        return new SQLParserEngine(
                new MySqlStatementParser(sql).parseStatement(),
                args,
                allTableShardingColumnsMapping);
    }
}
